package com.aaa.system.controller.api;

import com.aaa.security.annotation.MyLog;
import com.aaa.system.service.ChangePasswordService;
import com.aaa.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 崔灿
 * @Date 2023/03/02 14:39
 * @ClassName ChangePasswordController
 * @Description
 * @Version 1.0
 */

@Api(value = "/system/api/ChangePasswordController", tags = {"修改密码"})
@RestController
@RequestMapping("/system/api/ChangePasswordController")
public class ChangePasswordController {

    @Autowired
    private ChangePasswordService changePasswordService;


    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "passold", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "GET")
    @GetMapping("/change")
    public Result ChangePassword(String passold){
        return changePasswordService.ChangePassword(passold);
    }
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", dataType = "string", name = "pass", value = "", required = true)
    })
    @ApiOperation(value = "", notes = "", httpMethod = "POST")
    @MyLog(title="修改密码")
    @PostMapping("/changepassword")
    public Result ChangePassword1(String pass){
        return changePasswordService.ChangePassword1(pass);
    }
}
